package com.niubility.shiro;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.apache.shiro.session.Session;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class ShiroService {
	public static final String VERIFY_CODES = "23456789ABCDEFGHJKLMNPQRSTUVWXYZ";
	@RequiresRoles("admin")
	public void testMethod() {
		////System.out.println("testMethod,time:" + new Date());
		Session session = SecurityUtils.getSubject().getSession();
		////System.out.println(session.getId());
		
		Object val = session.getAttribute("key");
		
		////System.out.println("Service SessionVal :"+val);
	}
}
